package com.zzy.springbootdemo.design_01_factory.simple.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserService {

    private static class User{

    }

    @Transactional
    public void addUser(User user) {
        // 添加用户的业务逻辑
    }

    @Transactional
    public void deleteUser(int userId) {
        // 删除用户的业务逻辑
    }

    @Transactional(readOnly = true)
    public User getUser(int userId) {
        // 获取用户的业务逻辑
        return null;
    }
}
